package com.thread.threadlocal;

import java.io.IOException;

/**
 * @author: 一个小菜逼
 * @Date: 2020/4/6
 */
public class MyThreadLocalTest {

    //private static ThreadLocal<Object> threadLocal=new ThreadLocal<Object>();

    public static void main(String[] args) {
        MyThreadLocalTest myThreadLocalTest = new MyThreadLocalTest();
        ThreadLocal<Object> o1 = new ThreadLocal<Object>();
        o1.set(new Object());
        Thread thread = Thread.currentThread();
        myThreadLocalTest.test();
    }

    public void test(){
        ThreadLocal<Object> objectThreadLocal = new ThreadLocal<Object>();
        objectThreadLocal.set(new Object());
        Thread thread = Thread.currentThread();
        try {
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
